package com.example.it.studymenu;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

public class HomeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
    }

    public void click(View view) {
        Button btn = (Button) view;
        String text = btn.getText().toString();

        if (text.startsWith("O")) {
            Intent intent = new Intent(this, OptionsActivity.class);
            this.startActivity(intent);
        }

        if (text.startsWith("C")) {
            Intent intent = new Intent(this, ContextMenuActivity.class);
            this.startActivity(intent);
        }
        if (text.startsWith("S")) {
            Intent intent = new Intent(this, SubMenuActivity.class);
            this.startActivity(intent);
        }
        if (text.startsWith("P")) {
            Intent intent = new Intent(this, PopupMenuActivity.class);
            this.startActivity(intent);
        }
    }
}
